#include "vectorfunctions.h"
#include <iostream>

int main()
{
	int mat[10][10], temp[10][10];
	int x[100];
	int i, j, k, l, row, col, times=1;
	cout<<"Number of rows ";
	cin>>row;
	cout<<"Number of colons ";
	cin>>col;
	for (i=0; i<row; i++)
		for (j=0; j<col; j++){
			cout<<"m["<<i<<"]["<<j<<"]= ";
			cin>>mat[i][j];	
		}
	cout<<"Puterea k la care vreti sa ridicati matricea : " ;
	cin>>k;
			
	for (i=0; i<row; i++){
		for (j=0; j<col; j++)
			cout<<mat[i][j]<<" ";
		cout<<endl;	
		}
	cout<<endl;

	while(times<k){
		for (i=0; i<row; i++)
			for (j=0; j<col; j++)
				for(l=0; l<col ; ++l)
					temp[i][j]=mat[i][l]*mat[l][j];
		for (i=0; i<row; i++)
			for (j=0; j<col; j++)
				mat[i][j]=temp[i][j];
		++times;
	}
	
	for (i=0; i<row; i++){
		for (j=0; j<col; j++)
			cout<<mat[i][j]<<" ";
		cout<<endl;	
		}
	
	
return 0;
}
